home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir39 / d86v372.zip / D06.DOC < prev    next >
Text File  |  1994-01-24  |  20KB  |  430 lines

  1. CHAPTER 6   MEMORY DISPLAY OPTIONS
  2.  
  3.  
  4. Memory Display Windows
  5.  
  6. The debugger allows you to set up windows into your program
  7. memory space. Using these windows, you can view memory in a
  8. variety of formats.  The windows will remain in effect until you
  9. cancel them; updating themselves automatically if the memory
  10. changes.
  11.  
  12. There are six single-line memory windows always present, in the
  13. lower right portion of the screen.  In addition, you can have the
  14. upper-right window display a 14-line page of memory values.
  15.  
  16.  
  17. Single-Line Memory Windows
  18.  
  19. A single-line memory window line consists of a specification,
  20. typed in by you, followed by a display, supplied by the debugger.
  21.  
  22. To type in a specification on any one of window lines 1 through
  23. 6, simply type the associated digit, 1 through 6, when the
  24. debugger is in its main command mode.  The cursor will jump to
  25. the beginning of the memory-window line you are specifying.  You
  26. then type in a display format specification, followed by the
  27. address of memory you want displayed.
  28.  
  29. The simplest form of the display format specification is a single
  30. letter, signifying one of the display types available.  The
  31. choices are:
  32.  
  33.    B     for hexadecimal bytes
  34.    W     for hexadecimal words
  35.    N     for decimal bytes
  36.    D     for decimal words
  37.    Q     for octal bytes
  38.    O     for octal words
  39.    T     for text; each byte reduced to one ASCII display character
  40.    A     for ASCII text, each byte occupying 2 display characters (the exact
  41.                     display is spelled out later in this chapter)
  42.    C     for ASCII characters, occupying 2 bytes if needed, otherwise one
  43.  
  44. A format specification of one of the above letters will cause the
  45. debugger to display the array of bytes starting at the address
  46. you specify, in the format indicated by the letter, as long as
  47. there is room on the line. All letters in a format specification
  48. (or in any other context in the debugger) can be typed in either
  49. upper or lower case.
  50.  
  51. The format specification should be terminated by a comma.  After
  52. the comma (and an optional space), you type the address of memory
  53. you want displayed. This consists of two values, the segment
  54. followed by the offset.  The values should be separated by a
  55. comma. You can omit the segment value if you wish: in that case,
  56. the current value of DS is used. The debugger reminds you that
  57. you have specified this option by following what you type with 2
  58. commas instead of one.
  59.                                                               6-2
  60.  
  61. The value you type can take one of the following forms:
  62.  
  63.    a. a numeric constant, whose format is just as in the assembly
  64.       language (leading zero means default hex, otherwise default
  65.       decimal)
  66.  
  67.    b. a register name (IP is now accepted as a register name)
  68.  
  69.    c. a user symbol from the assembly language program being
  70.       debugged.
  71.  
  72. After you type the address specification, you hit the ENTER key,
  73. and the debugger fills out the rest of the line with the memory
  74. display.
  75.  
  76. For example, if you want to display hex bytes starting at 01000
  77. hex on display line 2, you type 2b,01000<ENTER>. The cursor jumps
  78. to the line immediately when you type the 2, and it displays the
  79. b,01000 on the line as you type it.  The b says you want hex
  80. bytes, and the 01000 has a leading zero to signify a hexadecimal
  81. address, not decimal.  When you press the ENTER key, the debugger
  82. displays two commas, followed by the hex bytes.  If the memory is
  83. zeroed, you will see 00 00 00 00 00 etc. to the end of the
  84. display line.
  85.  
  86.  
  87. Erasing Memory Display Lines
  88.  
  89. Any memory display window that you specify will remain in effect,
  90. always updated to show the latest memory contents, until you
  91. explicitly erase it. To erase a window, you type the number of
  92. the window, followed by a blank.  The line will also be erased if
  93. you start typing a format specification, and you hit the ENTER
  94. key before you get to your address specification.
  95.  
  96. In the coming sections, many of the examples assume (and they say
  97. so) that your display is blank before you type in the example.
  98. You can always get a blank display by typing in each number
  99. followed by a blank: "1 2 3 4 5 6 ".
  100.  
  101. If you accidentally type a digit and DON'T want to erase the line
  102. your cursor has jumped to, press the ESC key to return to the
  103. main command mode.
  104.  
  105.  
  106. Continuation Lines
  107.  
  108. You may continue a memory display window onto the next line, by
  109. placing a double quote mark " at the beginning of the next line.
  110. You may do this in one of two ways: you may type the number of
  111. the next line, followed by the double quote mark; or you may
  112. simply type the double quote mark at the command level.  The
  113. first method allows you to specify which window line you want
  114. continued, if there is more than one.  The second method is more
  115. convenient to use.  It places the quote mark on the last blank
  116. line that immediately follows a non-blank line.
  117.                                                               6-3
  118.  
  119. You may continue placing " marks on as many lines as you have,
  120. creating a multi-line display.
  121.  
  122. The debugger follows the " mark with the address of memory being
  123. displayed, followed by the memory, according to the start of the
  124. type specification of the line being continued.  The memory
  125. display is aligned with the display of above line.
  126.  
  127. If you are creating a multi-line display, and your specification
  128. is a long one, you may wish to start the display at the beginning
  129. of the next line, rather than after the specification on the
  130. first line.  This will often give you more room.  You do this by
  131. terminating the format specification with a slash / instead of a
  132. comma.  For example, to display many hex bytes at the array
  133. BYTE_ARRAY, type 1b/byte_array<ENTER> followed by five double
  134. quote marks, when the memory display is empty.
  135.  
  136.  
  137. Mixed Format Specification
  138.  
  139. Instead of having all your bytes or words on a line displayed in
  140. the same format, you can mix your formats.  You do this by
  141. providing more than one letter in your format specification.  The
  142. debugger will display one memory unit for each letter-type you
  143. specify.  The line will be filled out with the last type given.
  144. For example, if you type 3nwb,01000<ENTER>, you will get a
  145. display on memory line 3 of the decimal byte at 01000, the hex
  146. word at 01001, and an array of hex bytes starting at 01003.
  147.  
  148.  
  149. Numbers in a Format Specification
  150.  
  151. You may precede any letter in a format specification with a
  152. number up to 255. The effect is the same as if you had repeated
  153. the letter the given number of times.  For example, if you type 1
  154. to go to memory line 1, followed by 4w10tb,02000<ENTER>, you will
  155. get 4 hex words at 02000, 10 text characters at 02008, and an
  156. array of hex bytes from 02012 filling out the rest of the line.
  157.  
  158. You may also end your format specification with a number up to
  159. 255.  This will cause the entire specification to be repeated the
  160. given number of times. If there is room on the line for the full
  161. number given, the display will stop there-- there will be no
  162. repeating of the last type byte.  If there is not room on the
  163. line for the full number of global iterations, the debugger will
  164. stop at the end of the last iteration that would fit.  For
  165. example, the specification b8 causes 8 hex bytes to be displayed,
  166. and the remainder of the display line to be blank.  The
  167. specification b3w9 will cause the debugger to try to output 9
  168. records, each consisting of a hex byte followed by 3 hex words.
  169. After putting out 2 such records, the debugger will see that
  170. there is not room for a third full record, so it will stop.  This
  171. stopping at the record boundary allows you to continue the
  172. display, with correct alignment, on subsequent lines.
  173.                                                               6-4
  174.  
  175. Spacing Between Memory Display Units
  176.  
  177. In general, the debugger provides a space between each unit (byte
  178. or word) it displays.  There is an exception, however: the
  179. debugger will not space between adjacent text characters (A,C, or
  180. T specifications).
  181.  
  182. There are special specifiers G, J, and M, described in the
  183. section below, that allow you to override the debugger's spacing
  184. policies.
  185.  
  186.  
  187. Special-Action Format Specifiers
  188.  
  189. In addition to the 9 letters already mentioned that specify data
  190. types, there are 10 other letters, and 2 other characters, that
  191. cause the debugger to perform special actions.  Following is a
  192. complete description of all 21 non-digit characters that can
  193. occur within a format specification:
  194.  
  195. =  causes a display, using the format of the letter following =,
  196.    of the current memory pointer value, instead of the contents
  197.    of the memory location.  If a letter does not follow the =,
  198.    then W is used; i.e., the pointer is displayed as a 4-digit
  199.    hex word.  There are two uses for this feature that come to
  200.    mind:
  201.  
  202.    * If your address specification is symbolic, you can display
  203.      the equivalent numeric address with =w, telling you exactly
  204.      where the symbol is in memory.  Note that this display
  205.      implicitly occurs at the beginning of continuation lines. If
  206.      the format specification begins with =, then the implicit
  207.      display is suppressed, because the same address is given
  208.      explicitly by the L.
  209.  
  210.    * You can display the values of registers in a format other
  211.      than hex.  For example, in the 8086 debugger you can display
  212.      AX as a decimal number by specifying =d1,ax on one of the
  213.      memory display lines.
  214.  
  215. @  causes the debugger to read the next byte it was going to
  216.    display, and instead of displaying the byte, use it as a
  217.    count, to repeat the next letter in the specification.  The
  218.    debugger uses only the bottom 7 bits of the memory byte for
  219.    the count.  For example, if the memory contains a length byte
  220.    followed by that number of text characters, the text could be
  221.    displayed by specifying @t (or @a or @c, depending on what you
  222.    want the display to look like).  If the memory contains 05 41
  223.    42 43 44 45, the @t would cause ABCDE to be displayed.
  224.  
  225. A  causes a display of a single ASCII byte, always using 2
  226.    display bytes. The following table shows what is displayed for
  227.    unusual bytes:
  228.                                                               6-5
  229.  
  230.      range of N        display of N                Example
  231.  
  232.      00--1F            ^ followed by N+040         02 is ^B
  233.      22                ""
  234.      23                "#
  235.      24                "$
  236.      5E                "^
  237.      7F                ^r  (r stands for rubout)
  238.      80--9F            $ followed by N-080+040     081 is $A
  239.      A0--FE            # followed by N-080         0B1 is #1
  240.      FF                $r
  241.  
  242.    All other bytes cause a display of a space following by the
  243.    appropriate ASCII byte.  The A specification is used when you
  244.    need guaranteed display length for proper alignment of
  245.    continuation lines; and you do not want the potential loss of
  246.    information provided by the single-byte T specification.
  247.  
  248. B  causes a display of a single byte as a 2-digit hexadecimal
  249.    number.  Numbers less than hex 10 have a leading 0, so that
  250.    the display is always 2 digits.
  251.  
  252. C  causes a display of a single ASCII character, just as the A
  253.    specification, except that normal characters (not in the
  254.    table) display as just one byte, without the preceding space.
  255.  
  256. D  causes the display of a 16-bit word as an unsigned positive
  257.    decimal number. There will be no leading zeros in the display;
  258.    so the length of the display depends on the size of the
  259.    number.
  260.  
  261. F  causes the display of a floating point number, in one of the
  262.    three formats recognized by the 8087.  You must have a
  263.    floating point chip (8087 or 287) installed in your computer
  264.    for this to work.  You specify which of the three formats you
  265.    are reading by one of three letters immediately following the
  266.    letter F:
  267.  
  268.    FD  specifies a 4-byte Doubleword (single precision) number
  269.    FQ  specifies an 8-byte Quadword (double precision) number
  270.    FT  specifies a Ten-byte number-- 8087 extended precision.
  271.  
  272. G  causes a gap between the adjacent display formats, of one
  273.    space more than there would have been without the G.  For
  274.    adjacent string bytes, this means a space where there would
  275.    have been none.  For other data types, this means two spaces
  276.    where there would have been one.
  277.  
  278. J  (join) causes two adjacent data types, that would have had a
  279.    space between them, to have no space.
  280.                                                               6-6
  281.  
  282. L  (line) causes the display of an entire text line, using the
  283.    C-format for each character of the line.  The debugger does
  284.    not display the terminating carriage return; nor does it
  285.    display the following linefeed if there is one.  (If you want
  286.    it to, specify LUC or LUUCC instead of L.)  If a carriage
  287.    return is not found and the display line fills, then the
  288.    L-specifier is cut off in mid-string.  Any continuation line
  289.    will start up at the beginning of the format specification, at
  290.    the mid-string place in memory.
  291.  
  292. M  (mark) causes a vertical-bars symbol to be displayed.  The
  293.    symbol will replace a separating space that would have been
  294.    output in the position.  If you want the space, you can
  295.    provide G on either side (or both sides) of the M.
  296.  
  297. N  (number) causes the display of an 8-bit byte as an unsigned
  298.    positive decimal number.  There will be no leading zeroes in
  299.    the display; so the length of the display depends on the size
  300.    of the number.
  301.  
  302. O  causes a display of a 16-bit word as a 6-digit octal number.
  303.    Numbers less than octal 100000 have one or more leading
  304.    zeroes, so that the display is always 6 digits.
  305.  
  306. Q  causes a display of a single byte as a 3-digit octal number.
  307.    Numbers less than octal 100 have one or more leading zeroes,
  308.    so that the display is always 3 digits.
  309.  
  310. S  causes the display of an entire null-terminated string, using
  311.    the C-format for each character of the string.  The
  312.    terminating null (hex 00) does not generate a display (if you
  313.    want it to, specify SUC instead of S).  If a null is not found
  314.    and the display line fills, then the S-specifier is cut off in
  315.    mid-string.  Any continuation line would start up at the
  316.    beginning of the format specification, at the mid-string place
  317.    in memory.
  318.  
  319. T  causes the display of a single ASCII text byte, with a
  320.    guaranteed display space of one character.  The character
  321.    displayed is the same as the second character of the A-format.
  322.    This means that you will not be able to tell the difference
  323.    between normal, displaying ASCII characters, and their control
  324.    and non-ASCII counterparts.  You gain a compact
  325.    representation, but you also gain ambiguity.
  326.  
  327. U  (unskip) causes the memory display pointer to decrement by one
  328.    byte.   No display is generated by this command.  This command
  329.    is useful in several contexts:
  330.  
  331.    * displaying memory in more than one format.  For example, the
  332.      specification 8b8u2g8a gives a hex-and-ASCII side-by-side
  333.      display, similar to that provided by many memory dump
  334.      programs.
  335.                                                               6-7
  336.  
  337.    * displaying memory out of its sequence order.  To test your
  338.      understanding of the special-action letters in a format
  339.      specification, you should convince yourself that the
  340.      specification xb2ujbx99/ gives the same display on the
  341.      following " continuation line as the specification w/ does.
  342.  
  343.    * displaying the count byte consumed by the @ character.  For
  344.      example, instead of @t, you could specify nu@t, which would
  345.      display the string count as well as the string.  If memory
  346.      were 05 41 42 43 44 45, this would be 5 ABCDE.
  347.  
  348. W  causes a display of a 16-bit word as a 4-digit hex number.
  349.    Numbers less than hex 1000 have one or more leading zeroes, so
  350.    that the display is always 4 digits.
  351.  
  352. X  causes the debugger to skip over the memory byte currently
  353.    pointed to, without displaying it.  The memory pointer is thus
  354.    incremented.
  355.  
  356. Z  is given immediately following another format letter.  It
  357.    causes the display to fill out the line with displays of the
  358.    given preceding format; but instead of starting with the given
  359.    address, the debugger starts with a lower address, and
  360.    displays memory up to but not including the given address.
  361.  
  362.    The most common usage of Z is to display the memory just
  363.    output by a moving output pointer.  For example, in the 8086
  364.    debugger, you could specify bz,es,di to display the hex bytes
  365.    most recently output by the STOSB instruction.
  366.  
  367.    Note that Z makes sense only in a limited number of contexts.
  368.    You will almost certainly want to use Z only as the second
  369.    letter of a two-letter specification, as in the example above.
  370.    I further recommend that you use a format letter that
  371.    generates a fixed length display; i.e., B,W,Q,O,T, or C.  If
  372.    you use a variable length display (N,D, or A), the debugger
  373.    will be as pessimistic as possible about the number of display
  374.    characters needed, so that the display will likely terminate
  375.    before the end of the line.
  376.  
  377.    A continuation of a Z-line will produce the same output as the
  378.    original line.  If you want to continue beyond the address
  379.    given, repeat the specification without the Z.
  380.  
  381.    I now discuss what happens if you use Z in other contexts.
  382.    Unless your taste runs to the bizarre, you should skip this
  383.    paragraph.  Since Z fills out a line, there should be no
  384.    specifiers after Z: they would be ignored.  Also note that Z
  385.    has an effect only on the single letter that precedes it.  If
  386.    you precede Z with more than one letter, you will get a
  387.    confusing effect: the display would start out forward from the
  388.    address, then it would retreat when it got to Z's preceding
  389.    letter.  The Z-array would run up to the address reached
  390.    before, which is forward from the address you specified.
  391.                                                               6-8
  392.  
  393. The Data Memory Window
  394.  
  395. You may cause the switchable window in the upper right quadrant
  396. of the screen to display 14 lines of memory, continuing from the
  397. last of the lines you specified within the 6-line memory area. To
  398. do this, you:
  399.  
  400. 1. Type a format-and-address specification on one of the numbered
  401.    memory lines, as previously described in this chapter.  For
  402.    example, to display Bytes at location DS:0100, type 6b,ds,0100
  403.    followed by the ENTER key.
  404.  
  405. 2. If you have already selected the memory window, you'll
  406.    automatically have a continuation of the memory line you just
  407.    specified, into the upper right quadrant of the screen.  If
  408.    not, you may select the window by pressing either the ctrl-N
  409.    or ctrl-P keys.
  410.  
  411. Once you have set up a 14-line window, you may page through
  412. memory with the ctrl-N (Next memory page) and ctrl-P (Previous
  413. memory page) keys, described in Chapter 4.
  414.  
  415. If, after having pressed ctrl-N or ctrl-P several times, you wish
  416. to return to the first window continuing from the address you
  417. specified, you may do so by typing the digit (1 to 6) of the last
  418. specification line, followed immediately by the ESC key to
  419. preserve the specification settings.  The memory window will be
  420. reset to its continuation value.  For example, if your
  421. specification was on line 6, you type 6 followed immediately by
  422. the ESC key.
  423.  
  424. If you want your 14-line memory window to start at a certain
  425. address instead of continuing from a 1-line display, you can
  426. separate the format and the address with a slash instead of a
  427. comma.  For example, if you want Words at location ES:0, type 6
  428. followed by w/es,0 followed by the ENTER key.
  429.  
  430.